/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Wires.impl;

import EA_Model.IEC61970.Domain.Conductance;
import EA_Model.IEC61970.Domain.Reactance;
import EA_Model.IEC61970.Domain.Resistance;
import EA_Model.IEC61970.Domain.Susceptance;

import EA_Model.IEC61970.Wires.ACLineSegment;
import EA_Model.IEC61970.Wires.WiresPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>AC Line Segment</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ACLineSegmentImpl#getB0ch <em>B0ch</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ACLineSegmentImpl#getBch <em>Bch</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ACLineSegmentImpl#getG0ch <em>G0ch</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ACLineSegmentImpl#getGch <em>Gch</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ACLineSegmentImpl#getR <em>R</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ACLineSegmentImpl#getR0 <em>R0</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ACLineSegmentImpl#getX <em>X</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ACLineSegmentImpl#getX0 <em>X0</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ACLineSegmentImpl extends ConductorImpl implements ACLineSegment {
	/**
	 * The cached value of the '{@link #getB0ch() <em>B0ch</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getB0ch()
	 * @generated
	 * @ordered
	 */
	protected Susceptance b0ch;

	/**
	 * The cached value of the '{@link #getBch() <em>Bch</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBch()
	 * @generated
	 * @ordered
	 */
	protected Susceptance bch;

	/**
	 * The cached value of the '{@link #getG0ch() <em>G0ch</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getG0ch()
	 * @generated
	 * @ordered
	 */
	protected Conductance g0ch;

	/**
	 * The cached value of the '{@link #getGch() <em>Gch</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGch()
	 * @generated
	 * @ordered
	 */
	protected Conductance gch;

	/**
	 * The cached value of the '{@link #getR() <em>R</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getR()
	 * @generated
	 * @ordered
	 */
	protected Resistance r;

	/**
	 * The cached value of the '{@link #getR0() <em>R0</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getR0()
	 * @generated
	 * @ordered
	 */
	protected Resistance r0;

	/**
	 * The cached value of the '{@link #getX() <em>X</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getX()
	 * @generated
	 * @ordered
	 */
	protected Reactance x;

	/**
	 * The cached value of the '{@link #getX0() <em>X0</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getX0()
	 * @generated
	 * @ordered
	 */
	protected Reactance x0;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ACLineSegmentImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WiresPackage.Literals.AC_LINE_SEGMENT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Susceptance getB0ch() {
		if (b0ch != null && b0ch.eIsProxy()) {
			InternalEObject oldB0ch = (InternalEObject)b0ch;
			b0ch = (Susceptance)eResolveProxy(oldB0ch);
			if (b0ch != oldB0ch) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.AC_LINE_SEGMENT__B0CH, oldB0ch, b0ch));
			}
		}
		return b0ch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Susceptance basicGetB0ch() {
		return b0ch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setB0ch(Susceptance newB0ch) {
		Susceptance oldB0ch = b0ch;
		b0ch = newB0ch;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.AC_LINE_SEGMENT__B0CH, oldB0ch, b0ch));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Susceptance getBch() {
		if (bch != null && bch.eIsProxy()) {
			InternalEObject oldBch = (InternalEObject)bch;
			bch = (Susceptance)eResolveProxy(oldBch);
			if (bch != oldBch) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.AC_LINE_SEGMENT__BCH, oldBch, bch));
			}
		}
		return bch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Susceptance basicGetBch() {
		return bch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBch(Susceptance newBch) {
		Susceptance oldBch = bch;
		bch = newBch;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.AC_LINE_SEGMENT__BCH, oldBch, bch));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Conductance getG0ch() {
		if (g0ch != null && g0ch.eIsProxy()) {
			InternalEObject oldG0ch = (InternalEObject)g0ch;
			g0ch = (Conductance)eResolveProxy(oldG0ch);
			if (g0ch != oldG0ch) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.AC_LINE_SEGMENT__G0CH, oldG0ch, g0ch));
			}
		}
		return g0ch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Conductance basicGetG0ch() {
		return g0ch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setG0ch(Conductance newG0ch) {
		Conductance oldG0ch = g0ch;
		g0ch = newG0ch;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.AC_LINE_SEGMENT__G0CH, oldG0ch, g0ch));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Conductance getGch() {
		if (gch != null && gch.eIsProxy()) {
			InternalEObject oldGch = (InternalEObject)gch;
			gch = (Conductance)eResolveProxy(oldGch);
			if (gch != oldGch) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.AC_LINE_SEGMENT__GCH, oldGch, gch));
			}
		}
		return gch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Conductance basicGetGch() {
		return gch;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setGch(Conductance newGch) {
		Conductance oldGch = gch;
		gch = newGch;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.AC_LINE_SEGMENT__GCH, oldGch, gch));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resistance getR() {
		if (r != null && r.eIsProxy()) {
			InternalEObject oldR = (InternalEObject)r;
			r = (Resistance)eResolveProxy(oldR);
			if (r != oldR) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.AC_LINE_SEGMENT__R, oldR, r));
			}
		}
		return r;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resistance basicGetR() {
		return r;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setR(Resistance newR) {
		Resistance oldR = r;
		r = newR;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.AC_LINE_SEGMENT__R, oldR, r));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resistance getR0() {
		if (r0 != null && r0.eIsProxy()) {
			InternalEObject oldR0 = (InternalEObject)r0;
			r0 = (Resistance)eResolveProxy(oldR0);
			if (r0 != oldR0) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.AC_LINE_SEGMENT__R0, oldR0, r0));
			}
		}
		return r0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resistance basicGetR0() {
		return r0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setR0(Resistance newR0) {
		Resistance oldR0 = r0;
		r0 = newR0;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.AC_LINE_SEGMENT__R0, oldR0, r0));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Reactance getX() {
		if (x != null && x.eIsProxy()) {
			InternalEObject oldX = (InternalEObject)x;
			x = (Reactance)eResolveProxy(oldX);
			if (x != oldX) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.AC_LINE_SEGMENT__X, oldX, x));
			}
		}
		return x;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Reactance basicGetX() {
		return x;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setX(Reactance newX) {
		Reactance oldX = x;
		x = newX;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.AC_LINE_SEGMENT__X, oldX, x));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Reactance getX0() {
		if (x0 != null && x0.eIsProxy()) {
			InternalEObject oldX0 = (InternalEObject)x0;
			x0 = (Reactance)eResolveProxy(oldX0);
			if (x0 != oldX0) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.AC_LINE_SEGMENT__X0, oldX0, x0));
			}
		}
		return x0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Reactance basicGetX0() {
		return x0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setX0(Reactance newX0) {
		Reactance oldX0 = x0;
		x0 = newX0;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.AC_LINE_SEGMENT__X0, oldX0, x0));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WiresPackage.AC_LINE_SEGMENT__B0CH:
				if (resolve) return getB0ch();
				return basicGetB0ch();
			case WiresPackage.AC_LINE_SEGMENT__BCH:
				if (resolve) return getBch();
				return basicGetBch();
			case WiresPackage.AC_LINE_SEGMENT__G0CH:
				if (resolve) return getG0ch();
				return basicGetG0ch();
			case WiresPackage.AC_LINE_SEGMENT__GCH:
				if (resolve) return getGch();
				return basicGetGch();
			case WiresPackage.AC_LINE_SEGMENT__R:
				if (resolve) return getR();
				return basicGetR();
			case WiresPackage.AC_LINE_SEGMENT__R0:
				if (resolve) return getR0();
				return basicGetR0();
			case WiresPackage.AC_LINE_SEGMENT__X:
				if (resolve) return getX();
				return basicGetX();
			case WiresPackage.AC_LINE_SEGMENT__X0:
				if (resolve) return getX0();
				return basicGetX0();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WiresPackage.AC_LINE_SEGMENT__B0CH:
				setB0ch((Susceptance)newValue);
				return;
			case WiresPackage.AC_LINE_SEGMENT__BCH:
				setBch((Susceptance)newValue);
				return;
			case WiresPackage.AC_LINE_SEGMENT__G0CH:
				setG0ch((Conductance)newValue);
				return;
			case WiresPackage.AC_LINE_SEGMENT__GCH:
				setGch((Conductance)newValue);
				return;
			case WiresPackage.AC_LINE_SEGMENT__R:
				setR((Resistance)newValue);
				return;
			case WiresPackage.AC_LINE_SEGMENT__R0:
				setR0((Resistance)newValue);
				return;
			case WiresPackage.AC_LINE_SEGMENT__X:
				setX((Reactance)newValue);
				return;
			case WiresPackage.AC_LINE_SEGMENT__X0:
				setX0((Reactance)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WiresPackage.AC_LINE_SEGMENT__B0CH:
				setB0ch((Susceptance)null);
				return;
			case WiresPackage.AC_LINE_SEGMENT__BCH:
				setBch((Susceptance)null);
				return;
			case WiresPackage.AC_LINE_SEGMENT__G0CH:
				setG0ch((Conductance)null);
				return;
			case WiresPackage.AC_LINE_SEGMENT__GCH:
				setGch((Conductance)null);
				return;
			case WiresPackage.AC_LINE_SEGMENT__R:
				setR((Resistance)null);
				return;
			case WiresPackage.AC_LINE_SEGMENT__R0:
				setR0((Resistance)null);
				return;
			case WiresPackage.AC_LINE_SEGMENT__X:
				setX((Reactance)null);
				return;
			case WiresPackage.AC_LINE_SEGMENT__X0:
				setX0((Reactance)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WiresPackage.AC_LINE_SEGMENT__B0CH:
				return b0ch != null;
			case WiresPackage.AC_LINE_SEGMENT__BCH:
				return bch != null;
			case WiresPackage.AC_LINE_SEGMENT__G0CH:
				return g0ch != null;
			case WiresPackage.AC_LINE_SEGMENT__GCH:
				return gch != null;
			case WiresPackage.AC_LINE_SEGMENT__R:
				return r != null;
			case WiresPackage.AC_LINE_SEGMENT__R0:
				return r0 != null;
			case WiresPackage.AC_LINE_SEGMENT__X:
				return x != null;
			case WiresPackage.AC_LINE_SEGMENT__X0:
				return x0 != null;
		}
		return super.eIsSet(featureID);
	}

} //ACLineSegmentImpl
